import { _decorator, Component } from 'cc';
import { PageController } from '../core/page/PageController';
import { Page1 } from './Page1';
import { Page2 } from './Page2';
import { Page3 } from './Page3';
import { Page4 } from './Page4';
import { Page5 } from './Page5';
const { ccclass, property } = _decorator;

@ccclass('MainPages')
export class MainPages extends Component {

    private _pageController: PageController;

    start() {
        this._pageController = new PageController();
        this._pageController.addPage(0, this.node.getChildByName('page1').getComponent(Page1));
        this._pageController.addPage(1, this.node.getChildByName('page2').getComponent(Page2));
        this._pageController.addPage(2, this.node.getChildByName('page3').getComponent(Page3));
        this._pageController.addPage(3, this.node.getChildByName('page4').getComponent(Page4));
        this._pageController.addPage(4, this.node.getChildByName('page5').getComponent(Page5));
    }

    update(deltaTime: number) {

    }

    get pageController(): PageController {
        return this._pageController;
    }
}

